package com.bytech.admin.biz.enums;

import com.bytech.common.biz.enums.CommonStatusEnum;
import com.bytech.common.utils.StringUtils;
import com.google.common.collect.ImmutableList;
import lombok.Getter;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 系统配置 ID 枚举
 *
 * @Author Zhao
 * @Create 2021/8/14 12:50
 */
@Getter
public enum SystemSettingEnum {

    ROUTE_CONFIG("route_config", "网关路由配置"),
    ;

    private final String id;
    private final String desc;

    SystemSettingEnum(String id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    private static final Map<String, SystemSettingEnum> map = new HashMap<>(SystemSettingEnum.values().length);

    static {
        for (SystemSettingEnum e : SystemSettingEnum.values()) {
            map.put(e.id, e);
        }
    }

    public static SystemSettingEnum of(String id) {
        if (StringUtils.isBlank(id)) {
            return null;
        }
        return map.get(id) == null ? null : map.get(id);
    }
}
